class Person(object):
    def __init__(self, name, age=None):
        self.name = name
        self.age = age

    def dump(self):
        # print(self == xiaomu)  # True
        print(f"{self.name} is dumping.")

    def jump(self):
        print(f"{self.name} is jumping.")

    def work(self):
        self.dump()
        self.jump()


print("\033[H\033[J", end="")

xiaomu = Person(age=10, name="xiaomu")
print(xiaomu.name)
import inspect

print(f"# {inspect.currentframe().f_lineno} -- {xiaomu.age}")
xiaomu.dump()
xiaomu.jump()
xiaomu.work()
print(xiaomu)  # <__main__.Person object at 0x00000207B89EAAF0>
# <bound method Person.work of <__main__.Person object at 0x0000019B101FAAF0>>
print(xiaomu.work)

print(f"📢  {'= ' * 10}")

dewei = Person("dewei")
# 实例化对象可以自定义属性
dewei.top = 174
# 实例化对象的自定义属性，和别的对象不同用，是独属于自己的
print(dewei.top)  # 174
# print(xiaomu.top)  # AttributeError: 'Person' object has no attribute 'top'
dewei.work()
print(f"📢  {'= ' * 10}")
import inspect

print(f"# {inspect.currentframe().f_lineno} -- ")
